package org.lonetree.tc.core.dao;

import java.util.Set;
import org.lonetree.tc.core.User;
import org.lonetree.tc.core.User.Username;
import org.lonetree.tc.core.exception.AttributeCannotBeNullException;
import org.lonetree.tc.core.exception.ItemAlreadyExistsException;
import org.lonetree.tc.core.exception.NoSuchItemException;
import org.lonetree.tc.core.exception.SearchException;
import org.lonetree.tc.core.search.UserCriteria;


/**
 * JAVADOC UserDAO
 *
 * @author xeon
 *
 */
public interface UserDAO{

	/**
	 * JAVADOC UserDAO.getUser()
	 *
	 * @param username
	 * @return
	 * @throws NoSuchItemException
	 */
	public User getUser(Username username) throws NoSuchItemException;
	
	/**
	 * JAVADOC UserDAO.createUser()
	 *
	 * @param username
	 * @return
	 * @throws ItemAlreadyExistsException
	 */
	public User createUser(Username username) throws ItemAlreadyExistsException;
	
	/**
	 * JAVADOC UserDAO.removeUser()
	 *
	 * @param username
	 * @throws NoSuchItemException
	 */
	public void removeUser(Username username) throws NoSuchItemException;
	
	/**
	 * JAVADOC UserDAO.updateUser()
	 *
	 * @param user
	 * @throws NoSuchItemException
	 * @throws AttributeCannotBeNullException
	 */
	public void updateUser(User user) throws NoSuchItemException, AttributeCannotBeNullException;

	/**
	 * JAVADOC UserDAO.findUsers()
	 *
	 * @param criteria
	 * @return
	 * @throws SearchException
	 */
	public Set<User> findUsers(UserCriteria criteria) throws SearchException;
}
